<?php

namespace RSP\UserBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * ecole
 *
 * @ORM\Table()
 * @ORM\Entity
 */
class ecole
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="nom", type="string", length=255)
     */
    private $nom;
/**
   * @ORM\OneToMany(targetEntity="RSP\UserBundle\Entity\UserEcole",mappedBy="ecole", cascade={"persist"})
   */
  private $usersecoles;
  
    /**
     * Constructor
     */
    public function __construct()
    {
        $this->usersecoles = new \Doctrine\Common\Collections\ArrayCollection();
    }
    
    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set nom
     *
     * @param string $nom
     * @return ecole
     */
    public function setNom($nom)
    {
        $this->nom = $nom;
    
        return $this;
    }

    /**
     * Get nom
     *
     * @return string 
     */
    public function getNom()
    {
        return $this->nom;
    }

    /**
     * Add usersecoles
     *
     * @param \RSP\UserBundle\Entity\UserEcole $usersecoles
     * @return ecole
     */
    public function addUsersecole(\RSP\UserBundle\Entity\UserEcole $usersecoles)
    {
        $this->usersecoles[] = $usersecoles;
    
        return $this;
    }

    /**
     * Remove usersecoles
     *
     * @param \RSP\UserBundle\Entity\UserEcole $usersecoles
     */
    public function removeUsersecole(\RSP\UserBundle\Entity\UserEcole $usersecoles)
    {
        $this->usersecoles->removeElement($usersecoles);
    }

    /**
     * Get usersecoles
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getUsersecoles()
    {
        return $this->usersecoles;
    }
    public function __toString() {
        return $this->getNom();
    }
}